package com.jinlejia.feedback;

import android.content.Context;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * 测试网络拦截器，只有当FeedBack模块单独运行时，才会执行
 */

public class MockInterceptor implements Interceptor {
    private Context context;

    public MockInterceptor(Context c) {
        this.context = c;
    }
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        request = request.newBuilder()
                .addHeader("token", "%7B%22pin%22%3A%22123456789%22%2C%22test%22%3A%22E968D1C351FAD05E5E76D632CDCC4A61%22%2C%22ceshi%22%3A%220ce758c46f032b51bcf38c0978b1d7b5%22%7D")
                .addHeader("cookie",  "%7B%22pin%22%3A%22wangjin6091%22%2C%22test%22%3A%22AC2AE82F85CD5DF5E7336F9CA21813B4DD97826D0A6B7256A904C32CBBA2ABE8E156E70685B541E3%22%2C%22ceshi%22%3A%221096e9b45987e823b3c0082453a5388e%22%7D")
                .build();
        return chain.proceed(request);
    }
}
